#ifndef _COLLISIONDETECTION_H_
#define _COLLISIONDETECTION_H_

#include "GameApp.h"

class CCollisionDetection
{
public:
       CCollisionDetection(){}
       ~CCollisionDetection(){}

       static bool CCollisionDetection::isColliding(Ogre::AxisAlignedBox pobject1, Ogre::AxisAlignedBox pobject2)
       {
              // Intersect RECTs
			int i = 1;
			bool collided = false;
			
			if(pobject1.getMaximum().x > pobject2.getMinimum().x && pobject1.getMinimum().x < pobject2.getMaximum().x)
			{
				if(pobject1.getMaximum().y > pobject2.getMinimum().y && pobject1.getMinimum().y < pobject2.getMaximum().y)
				{
					if(pobject1.getMaximum().z > pobject2.getMinimum().z && pobject1.getMinimum().z < pobject2.getMaximum().z)
					{
						collided = true;
					}
				}
			}


			//x1.max > x2.in && x1.min < x2.max && y1.max > y2.in && y1.min < y2.max && z1.max > z2.in && z1.min < z2.max


			//bool boolcollision = IntersectRect(prect, &pobject1->getRect(), &pobject2->getRect());
			//bool boolcollision = pobject1.intersects(pobject2);
			
            return collided;
			  
       }

};
#endif